<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Add Resident</title>
	<link rel="stylesheet" href="jquery-ui-1.8.7.custom/development-bundle/themes/base/jquery.ui.all.css">
	<link rel="stylesheet" href="style.css">
	<script src="jquery-ui-1.8.7.custom/development-bundle/jquery-1.4.4.js"></script>
	<script src="jquery-ui-1.8.7.custom/development-bundle/ui/jquery.ui.core.js"></script>
	<script src="jquery-ui-1.8.7.custom/development-bundle/ui/jquery.ui.widget.js"></script>
	<script src="jquery-ui-1.8.7.custom/development-bundle/ui/jquery.ui.accordion.js"></script>
	<script src="jquery-ui-1.8.7.custom/development-bundle/ui/jquery.ui.datepicker.js"></script>
	<link rel="stylesheet" href="jquery-ui-1.8.7.custom/development-bundle/demos/demos.css">
	
	<script>
	$(function() {
		$( "#accordion" ).accordion({
			autoHeight: false,
			navigation: true,
			collapsible: true,
			active: -1
		});
	});
	</script>
	
	<script>
	$(function() {
		$( "#datepicker" ).datepicker({
			changeMonth: true,
			changeYear: true,
			dateFormat: 'yy/mm/dd',
			yearRange: '1950:2099'
		});
	});
	</script>
	
	<script>
	function OnSubmitForm(){
		if(document.pressed == "Add Resident"){
			if(document.adminform.firstname.value!=""&&
			document.adminform.middlename.value!=""&&
			document.adminform.lastname.value!=""&&
			document.adminform.studentnumber.value!=""&&
			document.adminform.birthday.value!=""&&
			document.adminform.classification.value!=""&&
			document.adminform.college.value!=""&&
			document.adminform.course.value!=""){
				document.adminform.action ="addResidentProcess.php";
				return true;
			}else{
			alert("Fill out all fields!");
			return false;}
		
		}else if(document.pressed == "Main Menu"){
			document.adminform.action ="administratorPage.php";
			return true;
		}
	}
	</script>
</head>
<body>

<div class="demo">
	
	<div id="header">
		<h1>ACCI DORM Management System</h1>
	</div>

	<div id="accordion">
		<h3><a href="#section1">Add a Resident</a></h3>
		<form name="adminform" method="post" onSubmit="return OnSubmitForm();">
		<h3>Resident's Information</h3>
		<div>
			<ul>
				<li>First Name:<br/><input type="text" name="firstname"/></li>
				<li>Middle Name:<br/><input type="text" name="middlename"/></li>
				<li>Last Name:<br/><input type="text" name="lastname"/></li>
				<li>Student Number:<br/><input type="text" name="studentnumber"/></li>
				<li>Birthday:<br/><input type="text" name="birthday" id="datepicker"/></li>
				<li>Classification:<br/>
					<select name="classification">
					<option>Freshman</option>
					<option>Sophomore</option>
					<option>Junior</option>
					<option>Senior</option>
					</select>
				</li>
				<li>College:<br/><input type="text" name="college"/></li>
				<li>Course:<br/><input type="text" name="course"/></li>
			</ul>
			<input type="reset"/>
			<input type="submit" value="Add Resident" onClick="document.pressed=this.value" />
			<input type="submit" value="Main Menu" onClick="document.pressed=this.value" />
		</div>
		</form>
	</div>

</div><!-- End demo -->

</body>
</html>
